import request from '@/config/axios'

// 离职档案 VO
export interface ResignationRecordsVO {
  id: number // 序号
  recordUserId: number // 离职员工id
  recordRealName: string // 离职员工姓名
  resignationDate: Date // 离职日期
  recordDeptId: number // 离职员工所在部门
  recordDeptName: string // 离职员工所在部门
  leaderUserId: number // 部门负责人
  leaderUserName: string // 部门负责人
  recipientId: number // 接收人
  recipientName: string // 接收人
  handoverStatus: number // 资料交接状态
  handoverIds: string // 参与交接人员
  handoverNames: string // 参与交接人员
  resignationReason: string // 离职原因
}

// 离职档案 API
export const ResignationRecordsApi = {
  // 查询离职档案分页
  getResignationRecordsPage: async (params: any) => {
    return await request.get({ url: `/oa/resignation-records/page`, params })
  },

  // 查询离职档案详情
  getResignationRecords: async (id: number) => {
    return await request.get({ url: `/oa/resignation-records/get?id=` + id })
  },

  // 新增离职档案
  createResignationRecords: async (data: ResignationRecordsVO) => {
    return await request.post({ url: `/oa/resignation-records/create`, data })
  },

  // 修改离职档案
  updateResignationRecords: async (data: ResignationRecordsVO) => {
    return await request.put({ url: `/oa/resignation-records/update`, data })
  },

  // 删除离职档案
  deleteResignationRecords: async (id: number) => {
    return await request.delete({ url: `/oa/resignation-records/delete?id=` + id })
  },

  // 导出离职档案 Excel
  exportResignationRecords: async (params) => {
    return await request.download({ url: `/oa/resignation-records/export-excel`, params })
  },
}